/// <reference types="vitest" />
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { resolve } from "path";
import vueJsx from "@vitejs/plugin-vue-jsx";

// https://vitejs.dev/config/
export default defineConfig({
	plugins: [vue(), vueJsx()],
	resolve: {
		alias: [
			{
				find: "@",
				replacement: resolve(__dirname, "src")
			}
		]
	},
	test: {
		// enable jest likes api
		globals: true,
		// simulate dom with happy-dom
		environment: "happy-dom",
		// 支持tsx测试，很关键
		transformMode: {
			web: [/.[tj]sx$/]
		}
	}
});

